package com.gyg.util;

import com.gyg.entity.User;
import org.apache.shiro.SecurityUtils;

/**
 * shiro工具类
 */
public class ShiroUtil {

    /**
     * 获取到当前用户的ID
     * @return
     */
    public static long getSubjectID(){
        User user =  (User) SecurityUtils.getSubject().getPrincipal();
        return user.getId();
    }

}
